<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    <div id="app">
       <p> {{ info }} </p> 
       <input type="button" value="开启" @click="go">
       <input type="button" value="停止" @click="stop">
    </div>
    <script>
        // var message = { a:1 };
       var vm = new Vue({
           el:"#app",
           data:{
              info:'猥琐发育，别浪~~！',
              intervalld:null
           },
           methods: {
               go(){
                   if (this.intervalld !=null) {
                       return;
                   }
                   //开启计时器
                   this.intervalld = setInterval(() => {
                       this.info = this.info.substring(1) + this.info.substring(0,1);
                   },500);
               },
               stop(){
                   clearInterval(this.intervalld);
               }
           },
       });
    </script>
</body>
</html>